﻿#ifndef NeoHookean_H_
#define NeoHookean_H_
#include "StructuralMaterial.h"
#define NeoHookean_Name "neohookean"
#define NeoHookean_e "e"
#define NeoHookean_nu "nu"

class NeoHookean : public StructuralMaterial
{
protected:
	// 杨式模量
	double e;
	// 泊松比
	double nu;
	// 拉梅常数+
	double lambda;
	double mu;
public:
	NeoHookean(int n, Domain* domain);

	void Compute3dCauchyStress(TimeStep* ctime,
	                           IntegrationPoint* ip) override;

	void ComputePlaneStrainCauchyStress(TimeStep* ctime,
	                                    IntegrationPoint* ip) override;
	tens4ds Compute3dMatStiffMatrix_dSigde(TimeStep* ctime, MaterialStiffnessMode rmode,
	                                       IntegrationPoint* ip) override;

	void ComputePlaneStrainMatStiffMatrix_dSigde(fmatrix<4, 4>& answer, TimeStep* ctime, MaterialStiffnessMode rmode,
	                                             IntegrationPoint* ip) override;

	void computeEffectiveLameiConstants(double& newLambda, double& newMu, double J);

	bool CMisSymmetric(MaterialStiffnessMode rmode) override { return true; }

	// 读入文件初始化
	InputType Initial(InputRecord* ir) override;
	void initial(Tag& tag) override;

	// 获取类名
	const char* GetClassName() const override { return "NeoHookean"; }
};

#endif
